<template>
  <Card>
    <Tabs value="养老">
      <TabPane label="养老" name="养老">
        <Form ref="yanglaoForm" :label-width="90" :model="yanglaoForm" inline>
          <FormItem label="日期：" prop="date">
            <DatePicker
              v-model="yanglaoForm.date"
              format="yyyy-MM"
              placeholder="选择时间"
              type="month"
              @on-change="yanglaoForm.date=$event"></DatePicker>
          </FormItem>
          <Form-item style="margin-left:-90px;">
            <Button icon="md-search" type="primary" @click="handleSearch('yanglao')">搜索</Button>
            <Button @click="handleReset('yanglao')">重置</Button>
          </Form-item>
        </Form>
        <div class="btns" style="margin-bottom:10px;">
          <upload-file
            ref="uploadYanglaoFile"
            button-name="上传"
            @on-change="uploadData($event, 'yanglao')">
          </upload-file>
        </div>
        <Table
          :columns="yanglaoColumn"
          :data="yanglaoData"
          :loading="yanglaoLoading"
          border
          size="small"
          stripe></Table>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="yanglaoForm.pageNumber"
            :page-size="yanglaoForm.pageSize"
            :total="yanglaoTotal"
            show-total
            @on-change="changePage($event, 'yanglao')"/>
        </Row>
      </TabPane>
      <TabPane label="医疗" name="医疗">
        <Form ref="yiliaoForm" :label-width="90" :model="yiliaoForm" inline>
          <FormItem label="日期：" prop="date">
            <DatePicker
              v-model="yiliaoForm.date"
              format="yyyy-MM"
              placeholder="选择时间"
              type="month"
              @on-change="yiliaoForm.date=$event"></DatePicker>
          </FormItem>
          <Form-item style="margin-left:-90px;">
            <Button icon="md-search" type="primary" @click="handleSearch('yiliao')">搜索</Button>
            <Button @click="handleReset('yiliao')">重置</Button>
          </Form-item>
        </Form>
        <div class="btns" style="margin-bottom:10px;">
          <upload-file
            ref="uploadYanglaoFile"
            button-name="上传"
            @on-change="uploadData($event, 'yiliao')">
          </upload-file>
        </div>
        <Table
          :columns="yiliaoColumn"
          :data="yiliaoData"
          :loading="yiliaoLoading"
          border
          size="small"
          stripe></Table>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="yiliaoForm.pageNumber"
            :page-size="yiliaoForm.pageSize"
            :total="yiliaoTotal"
            show-total
            @on-change="changePage($event, 'yiliao')"/>
        </Row>
      </TabPane>
      <TabPane label="失业" name="失业">
        <Form ref="shiyeForm" :label-width="90" :model="shiyeForm" inline>
          <FormItem label="日期：" prop="date">
            <DatePicker
              v-model="shiyeForm.date"
              format="yyyy-MM"
              placeholder="选择时间"
              type="month"
              @on-change="shiyeForm.date=$event"></DatePicker>
          </FormItem>
          <Form-item style="margin-left:-90px;">
            <Button icon="md-search" type="primary" @click="handleSearch('shiye')">搜索</Button>
            <Button @click="handleReset('shiye')">重置</Button>
          </Form-item>
        </Form>
        <div class="btns" style="margin-bottom:10px;">
          <upload-file
            ref="uploadYanglaoFile"
            button-name="上传"
            @on-change="uploadData($event, 'shiye')">
          </upload-file>
        </div>
        <Table
          :columns="shiyeColumn"
          :data="shiyeData"
          :loading="shiyeLoading"
          border
          size="small"
          stripe></Table>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="shiyeForm.pageNumber"
            :page-size="shiyeForm.pageSize"
            :total="shiyeTotal"
            show-total
            @on-change="changePage($event, 'shiye')"/>
        </Row>
      </TabPane>
      <TabPane label="工伤" name="工伤">
        <Form ref="gongshangForm" :label-width="90" :model="gongshangForm" inline>
          <FormItem label="日期：" prop="date">
            <DatePicker
              v-model="gongshangForm.date"
              format="yyyy-MM"
              placeholder="选择时间"
              type="month"
              @on-change="gongshangForm.date=$event"></DatePicker>
          </FormItem>
          <Form-item style="margin-left:-90px;">
            <Button icon="md-search" type="primary" @click="handleSearch('gongshang')">搜索</Button>
            <Button @click="handleReset('gongshang')">重置</Button>
          </Form-item>
        </Form>
        <div class="btns" style="margin-bottom:10px;">
          <upload-file
            ref="uploadYanglaoFile"
            button-name="上传"
            @on-change="uploadData($event, 'gongshang')">
          </upload-file>
        </div>
        <Table
          :columns="gongshangColumn"
          :data="gongshangData"
          :loading="gongshangLoading"
          border
          size="small"
          stripe></Table>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="gongshangForm.pageNumber"
            :page-size="gongshangForm.pageSize"
            :total="gongshangTotal"
            show-total
            @on-change="changePage($event, 'gongshang')"/>
        </Row>
      </TabPane>
      <TabPane label="个税" name="个税">建设中</TabPane>
      <TabPane label="工龄工资" name="工龄工资">
        <Form ref="gonglingForm" :label-width="90" :model="gonglingForm" inline>
          <FormItem label="日期：" prop="date">
            <DatePicker
              v-model="gonglingForm.date"
              format="yyyy-MM"
              placeholder="选择时间"
              type="month"
              @on-change="gonglingForm.date=$event"></DatePicker>
          </FormItem>
          <Form-item style="margin-left:-90px;">
            <Button icon="md-search" type="primary" @click="handleSearch('gongling')">搜索</Button>
            <Button @click="handleReset('gongling')">重置</Button>
          </Form-item>
        </Form>
        <div class="btns" style="margin-bottom:10px;">
          <upload-file
            ref="uploadYanglaoFile"
            button-name="上传"
            @on-change="uploadData($event, 'gongling')">
          </upload-file>
        </div>
        <Table
          :columns="gonglingColumn"
          :data="gonglingData"
          :loading="gonglingLoading"
          border
          size="small"
          stripe></Table>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="gonglingForm.pageNumber"
            :page-size="gonglingForm.pageSize"
            :total="gonglingTotal"
            show-total
            @on-change="changePage($event, 'gongling')"/>
        </Row>
      </TabPane>
      <TabPane label="预借绩效年薪" name="预借绩效年薪">建设中</TabPane>
      <TabPane label="公积金" name="公积金公积金">
        <Form ref="gongjijinForm" :label-width="90" :model="gongjijinForm" inline>
          <FormItem label="日期：" prop="date">
            <DatePicker
              v-model="gongjijinForm.date"
              format="yyyy-MM"
              placeholder="选择时间"
              type="month"
              @on-change="gongjijinForm.date=$event"></DatePicker>
          </FormItem>
          <Form-item style="margin-left:-90px;">
            <Button icon="md-search" type="primary" @click="handleSearch('gongjijin')">搜索</Button>
            <Button @click="handleReset('gongjijin')">重置</Button>
          </Form-item>
        </Form>
        <div class="btns" style="margin-bottom:10px;">
          <upload-file
            ref="uploadYanglaoFile"
            button-name="上传"
            @on-change="uploadData($event, 'gongjijin')">
          </upload-file>
        </div>
        <Table
          :columns="gongjijinColumn"
          :data="gongjijinData"
          :loading="gongjijinLoading"
          border
          size="small"
          stripe></Table>
        <Row class="page" justify="end" type="flex">
          <Page
            :current="gongjijinForm.pageNumber"
            :page-size="gongjijinForm.pageSize"
            :total="gongjijinTotal"
            show-total
            @on-change="changePage($event, 'gongjijin')"/>
        </Row>
      </TabPane>
    </Tabs>
    <Modal v-model="modal" :closable="false" :mask-closable="false" width="360">
      <p slot="header" style="color:#2d8cf0;text-align:center">
        <Icon type="ios-information-circle"></Icon>
        <span>文件上传成功，正在导入数据</span>
      </p>
      <div style="text-align:center">
        <Button :loading="importLoading" long size="large" type="error">导入中...</Button>
      </div>
      <div slot="footer">
      </div>
    </Modal>
  </Card>
</template>
<script>
import UploadFile from '../my-components/upload-file'
import {
  driverRecordList,
  gongjijinList,
  gonglingList,
  gongshangList,
  importGongjijin,
  importGongling,
  importGongshang,
  importGs,
  importOther,
  importShiye,
  importSy,
  importYiliao,
  importYl,
  shiyeList,
  yanglaoList,
  yiliaoList
} from '../../api/pay'

export default {
  components: {
    UploadFile,
  },
  data() {
    return {
      // 养老部分
      yanglaoForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      yanglaoLoading: false,
      yanglaoTotal: 0,
      yanglaoColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '月份',
          key: 'date',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '职位类别',
          key: 'type',
          align: 'center',
        },
        {
          title: '个人编号',
          key: 'self_number',
          align: 'center',
        },
        {
          title: '个人缴费基数',
          key: 'personal_base',
          align: 'right',
        },
        {
          title: '单位应缴',
          key: 'unit_payment',
          align: 'right',
        },
        {
          title: '个人应缴',
          key: 'personal_payment',
          align: 'right',
        },
        {
          title: '备注',
          key: 'remarks',
          align: 'left',
        },
      ],
      yanglaoData: [],
      // 医疗部分
      yiliaoForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      yiliaoLoading: false,
      yiliaoTotal: 0,
      yiliaoColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '月份',
          key: 'date',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '职位类别',
          key: 'type',
          align: 'center',
        },
        {
          title: '个人编号',
          key: 'self_number',
          align: 'center',
        },
        {
          title: '个人缴费基数',
          key: 'personal_base',
          align: 'right',
        },
        {
          title: '单位应缴',
          key: 'unit_payment',
          align: 'right',
        },
        {
          title: '个人应缴',
          key: 'personal_payment',
          align: 'right',
        },
        {
          title: '备注',
          key: 'remarks',
          align: 'left',
        },
      ],
      yiliaoData: [],
      // 失业部分
      shiyeForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      shiyeLoading: false,
      shiyeTotal: 0,
      shiyeColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '月份',
          key: 'date',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '职位类别',
          key: 'type',
          align: 'center',
        },
        {
          title: '个人编号',
          key: 'self_number',
          align: 'center',
        },
        {
          title: '个人缴费基数',
          key: 'personal_base',
          align: 'right',
        },
        {
          title: '单位应缴',
          key: 'unit_payment',
          align: 'right',
        },
        {
          title: '个人应缴',
          key: 'personal_payment',
          align: 'right',
        },
        {
          title: '备注',
          key: 'remarks',
          align: 'left',
        },
      ],
      shiyeData: [],
      // 工伤部分
      gongshangForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      gongshangLoading: false,
      gongshangTotal: 0,
      gongshangColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '月份',
          key: 'date',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '职位类别',
          key: 'type',
          align: 'center',
        },
        {
          title: '个人缴费基数',
          key: 'personal_base',
          align: 'right',
        },
        {
          title: '比例',
          key: 'proportion',
          align: 'right',
        },
        {
          title: '个人应缴',
          key: 'personal_payment',
          align: 'right',
        },
        {
          title: '备注',
          key: 'remarks',
          align: 'left',
        },
      ],
      gongshangData: [],
      // 工龄部分
      gonglingForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      gonglingLoading: false,
      gonglingTotal: 0,
      gonglingColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '月份',
          key: 'date',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '职位类别',
          key: 'type',
          align: 'center',
        },
        {
          title: '线路',
          key: 'line',
          align: 'center',
        },
        {
          title: '工龄工资',
          key: 'salary',
          align: 'right',
        },
      ],
      gonglingData: [],
      // 养老部分
      gongjijinForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      gongjijinLoading: false,
      gongjijinTotal: 0,
      gongjijinColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '月份',
          key: 'date',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          fixed: 'left',
        },
        {
          title: '职位类别',
          key: 'type',
          align: 'center',
        },
        {
          title: '个人编号',
          key: 'self_number',
          align: 'center',
        },
        {
          title: '个人缴费基数',
          key: 'personal_base',
          align: 'right',
        },
        {
          title: '单位应缴',
          key: 'unit_payment',
          align: 'right',
        },
        {
          title: '个人应缴',
          key: 'personal_payment',
          align: 'right',
        },
        {
          title: '备注',
          key: 'remarks',
          align: 'left',
        },
      ],
      gongjijinData: [],


      cashSelectList: [],
      cashSelectCount: 0,
      cashSubmitLoading: false,
      cashModalType: 0,
      cashModalVisible: false,
      cashModalTitle: '',
      cashForm: {
        date: '',
        license_plate_num: '',
        cash_income: 0,
      },
      searchCardForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      searchPostForm: {
        date: '',
        pageNumber: 1,
        pageSize: 10,
      },
      cardLoading: false,
      postLoading: false,
      cardData: [],
      postData: [],
      modal: false,
      importLoading: false,
      loading: false,
      cardTotal: 0,
      postTotal: 0,
      cardColumns: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          width: 100,
          fixed: 'left',
        },
        {
          title: '日期',
          key: 'date',
          width: 100,
          align: 'center',
        },
        {
          title: '基本工资',
          key: 'base_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '岗位工资',
          key: 'job_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '绩效工资',
          key: 'performance_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '车补',
          key: 'car_allowance',
          align: 'right',
          width: 100,
        },
        {
          title: '工龄工资',
          key: 'seniority_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '降温费',
          key: 'cool_fee',
          align: 'right',
          width: 100,
        },
        {
          title: '加班费',
          key: 'overtime_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '补发调资差额',
          key: 'difference_pay',
          align: 'right',
          width: 120,
        },
        {
          title: '请假',
          key: 'leave_deductions',
          align: 'right',
          width: 100,
        },
        {
          title: '迟到罚款',
          key: 'late_deductions',
          align: 'right',
          width: 100
        },
        {
          title: '未满年限服装费',
          key: 'clothes_cost',
          align: 'right',
          width: 130,
        },
        {
          title: '养老',
          key: 'endowment_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '医保',
          key: 'medical_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '失业',
          key: 'unemployment_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '工伤',
          key: 'injury_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '公积金',
          key: 'accumulation_fund',
          align: 'right',
          width: 100
        },
        {
          title: '个税',
          key: 'individual_income_tax',
          align: 'right',
          width: 100
        },
        {
          title: '会费',
          key: 'tu_membership_dues',
          align: 'right',
          width: 100
        },
      ],
      postColumn: [
        {
          type: 'index',
          width: 60,
          align: 'center',
          fixed: 'left',
        },
        {
          title: '姓名',
          key: 'name',
          align: 'center',
          width: 100,
          fixed: 'left',
        },
        {
          title: '日期',
          key: 'date',
          width: 100,
          align: 'center',
        },
        {
          title: '基本工资',
          key: 'base_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '修车补助',
          key: 'fix_car_allowance',
          align: 'right',
          width: 100,
        },
        {
          title: '工龄工资',
          key: 'seniority_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '收卡奖励',
          key: 'sell_card_rewards',
          align: 'right',
          width: 100,
        },
        {
          title: '加班费',
          key: 'overtime_pay',
          align: 'right',
          width: 100,
        },
        {
          title: '单车核算奖罚',
          key: 'bicycle_accounting',
          align: 'right',
          width: 120,
        },
        {
          title: '降温费',
          key: 'cool_fee',
          align: 'right',
          width: 100,
        },
        {
          title: '养老',
          key: 'endowment_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '医保',
          key: 'medical_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '失业',
          key: 'unemployment_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '工伤',
          key: 'injury_insurance',
          align: 'right',
          width: 100
        },
        {
          title: '个人所得税',
          key: 'individual_income_tax',
          align: 'right',
          width: 100
        },
        {
          title: '会费',
          key: 'tu_membership_dues',
          align: 'right',
          width: 100
        },
      ],
      lines: [],
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    changePage(v, event) {
      switch (event) {
        case 'card':
          this.searchCardForm.pageNumber = v
          this.getAdminRecordList()
          break
        case 'post':
          this.searchPostForm.pageNumber = v
          this.getIncomePostList()
          break
      }
    },
    getYanglaoData() {
      this.yanglaoLoading = true
      yanglaoList(this.yanglaoForm).then(res => {
        this.yanglaoLoading = false
        if (res.data) {
          this.yanglaoData = res.data.yanglaoData
          this.yanglaoTotal = res.data.count
        }
      })
    },
    getGongjijinData() {
      this.gongjijinLoading = true
      gongjijinList(this.gongjijinForm).then(res => {
        this.gongjijinLoading = false
        if (res.data) {
          this.gongjijinData = res.data.gongjijinData
          this.gongjijinTotal = res.data.count
        }
      })
    },
    getYiliaoData() {
      this.yiliaoLoading = true
      yiliaoList(this.yiliaoForm).then(res => {
        this.yiliaoLoading = false
        if (res.data) {
          this.yiliaoData = res.data.yiliaoData
          this.yiliaoTotal = res.data.count
        }
      })
    },
    getShiyeData() {
      this.shiyeLoading = true
      shiyeList(this.shiyeForm).then(res => {
        this.shiyeLoading = false
        if (res.data) {
          this.shiyeData = res.data.shiyeData
          this.shiyeTotal = res.data.count
        }
      })
    },
    getGongshangData() {
      this.gongshangLoading = true
      gongshangList(this.gongshangForm).then(res => {
        this.gongshangLoading = false
        if (res.data) {
          this.gongshangData = res.data.gongshangData
          this.gongshangTotal = res.data.count
        }
      })
    },
    getGonglingData() {
      this.gonglingLoading = true
      gonglingList(this.gonglingForm).then(res => {
        this.gonglingLoading = false
        if (res.data) {
          this.gonglingData = res.data.gonglingData
          this.gonglingTotal = res.data.count
        }
      })
    },
    getDriverRecordList() {
      this.cashSelectCount = 0
      this.cashSelectList = []
      this.cashLoading = true
      driverRecordList(this.searchPostForm).then(res => {
        this.postLoading = false
        if (res.data) {
          this.postData = res.data.personnel
          this.postTotal = res.data.count
        }
      })
    },
    handleReset(event) {
      switch (event) {
        case 'yanglao':
          this.$refs.yanglaoForm.resetFields()
          this.yanglaoForm.pageNumber = 1
          this.yanglaoForm.pageSize = 10
          this.getYanglaoData()
          break
        case 'gongjijin':
          this.$refs.gongjijinForm.resetFields()
          this.gongjijinForm.pageNumber = 1
          this.gongjijinForm.pageSize = 10
          this.getGongjijinData()
          break
        case 'yiliao':
          this.$refs.yiliaoForm.resetFields()
          this.yiliaoForm.pageNumber = 1
          this.yiliaoForm.pageSize = 10
          this.getYiliaoData()
          break
        case 'shiye':
          this.$refs.shiyeForm.resetFields()
          this.shiyeForm.pageNumber = 1
          this.shiyeForm.pageSize = 10
          this.getShiyeData()
          break
        case 'gongshang':
          this.$refs.gongshangForm.resetFields()
          this.gongshangForm.pageNumber = 1
          this.gongshangForm.pageSize = 10
          this.getGongshangData()
          break
        case 'gongling':
          this.$refs.gonglingForm.resetFields()
          this.gonglingForm.pageNumber = 1
          this.gonglingForm.pageSize = 10
          this.getGonglingData()
          break
      }
    },
    handleSearch(event) {
      switch (event) {
        case 'yanglao':
          this.yanglaoForm.pageNumber = 1
          this.yanglaoForm.pageSize = 10
          this.getYanglaoData()
          break
        case 'gongjijin':
          this.gongjijinForm.pageNumber = 1
          this.gongjijinForm.pageSize = 10
          this.getGongjijinData()
          break
        case 'yiliao':
          this.yiliaoForm.pageNumber = 1
          this.yiliaoForm.pageSize = 10
          this.getYiliaoData()
          break
        case 'gongshang':
          this.gongshangForm.pageNumber = 1
          this.gongshangForm.pageSize = 10
          this.getGongshangData()
          break
        case 'gongling':
          this.gonglingForm.pageNumber = 1
          this.gonglingForm.pageSize = 10
          this.getGonglingData()
          break
      }
    },
    init() {
      this.getLinesArray()
      this.getYanglaoData()
      this.getYiliaoData()
      this.getShiyeData()
      this.getGongshangData()
      this.getGonglingData()
      this.getGongjijinData()
    },
    async getLinesArray() {
      this.lines = await this.getLines()
    },
    uploadData(event, cardType) {
      this.modal = true
      this.importLoading = true
      switch (cardType) {
        case 'yanglao':
          importYl({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.getYanglaoData()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'gongjijin':
          importGongjijin({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.getGongjijinData()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'yiliao':
          importYiliao({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.getYiliaoData()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'shiye':
          importShiye({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.getShiyeData()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'gongshang':
          importGongshang({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.getGongshangData()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'gongling':
          importGongling({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.getGonglingData()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'gs':
          importGs({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.init()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'sy':
          importSy({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.init()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
        case 'other':
          importOther({url: event.url}).then(res => {
            if (res.data) {
              this.$Message.success(res.message)
              this.init()
            } else {
              this.$Message.error(res.message)
            }
            this.modal = false
            this.importLoading = false
          })
          break
      }
    },
  }
}
</script>
<style>
.ivu-tabs .ivu-select-dropdown {
  left: 0 !important;
}
</style>
